package com.ym.medical.service;

import com.github.pagehelper.PageInfo;
import com.ym.core.utils.tkmybatis.IBaseSV;
import com.ym.medical.domain.entity.InformationEntity;
import com.ym.medical.domain.entity.InquiryOrderEntity;
import com.ym.medical.domain.entity.TopicEntity;
import com.ym.medical.domain.param.AddressListParam;
import com.ym.medical.domain.param.InformationParam;
import com.ym.medical.domain.vo.InformationVo;
import com.ym.medical.enums.PlaformSourceEnum;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 平台公告、医生接单后回复了你的消息、退款成功通知、医生发布的新话题Service接口
 *
 * @author ym
 * @date 2020-08-21
 */
public interface IInformationSV extends IBaseSV<InformationEntity> {


	/**
	 * 构建话题消息并发送
	 *
	 * @param topic
	 * @param addressLists 接受对象
	 * @return
	 */
	void generateTopicInformation(TopicEntity topic, List<AddressListParam> addressLists);


	/**
	 * 支付消息
	 * @param sendObj
	 * @param receiver
	 * @param title
	 * @param content
	 * @param infoUrl
	 * @param destination
	 * @param extObj
	 * @param extIoNum
	 * @param paymentPrice
	 * @param tdTime
	 */
	void generatePayInformation(Long sendObj, Long receiver, String title, String content, String infoUrl, String destination, Object extObj, String extIoNum, BigDecimal paymentPrice, Date tdTime, PlaformSourceEnum PlaformSourceEnum);

	/**
	 * 构建订单异常消息并发送
	 *
	 * @param order  订单
	 * @param upType 举报类型
	 * @param
	 */
	void generateOrderException(InquiryOrderEntity order, Long doctorId, String upType, String remark);

	/**
	 * 构建退费消息并发送
	 *
	 * @param order 订单id
	 * @param payee 收款方id
	 */
	void generateRefordInformation(InquiryOrderEntity order, Long payee);

	/**
	 * 构建电话预约消息并发送
	 *
	 * @param sendObj
	 * @param receiverObj
	 * @param title
	 * @param content
	 * @param infoUrl
	 * @param orderId     (josn必传项 ioNum-订单号 patientName-患者姓名 doctorName-医生姓名 illnessDesc-疾病描述 appointTime-预约时间 paymentPrice-支付费用)
	 */
	void generatePhoneInquiryInformation(Long sendObj, Long receiverObj, String title, String content, String infoUrl, Long orderId);

	/**
	 * 构建问诊消息并发送
	 *
	 * @param orderId 订单id
	 * @param title   订单问诊通知标题
	 */
	void generateInquiryInformation(Long orderId, String title);


	/**
	 * 消息分组统计
	 *
	 * @param informationModel
	 * @return
	 */
	List<InformationVo> countNoReadInformation(InformationParam informationModel);

	/**
	 * 获取医生端的未读消息数量
	 *
	 * @param id
	 * @return
	 */
	List<InformationVo> informationUnread(Long id);

	/**
	 * 消息列表展示
	 *
	 * @param model
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	Map<String, Object> listPageInformation(InformationParam model, int pageNum, int pageSize);


	/**
	 * 随访消息列表
	 *
	 * @param pageNo
	 * @param pageNum
	 * @param model
	 * @return
	 */
	PageInfo<InformationEntity> infoMessage(int pageNo, int pageNum, InformationParam model);
}
